package pdm.yamba.dto;

import java.util.Date;

import winterwell.jtwitter.Twitter;

public class Status implements IContent 
{
	private long id;
	private String message;
	private String author;
	private Date publishDate;
	
	public Status() 
	{
		message = "";
		author = "";
		publishDate = new Date();
	}
	
	public Status(String message, String author, long publishDate) 
	{
		this.setMessage(message);
		this.setAuthor(author);
		
		this.setPublishDate(new Date(publishDate));
	}

	public Status(Twitter.Status tStatus)
	{
		id = tStatus.getId();
		message = tStatus.getText();
		author = tStatus.getUser().name;
		publishDate = tStatus.createdAt;
	}
	
	public long getId() 
	{
		return id;
	}

	public void setId(long id) 
	{
		this.id = id;
	}

	public String getMessage() 
	{
		return message;
	}

	public void setMessage(String message) 
	{
		this.message = message;
	}

	public String getAuthor() 
	{
		return author;
	}

	public void setAuthor(String author) 
	{
		this.author = author;
	}

	public Date getPublishDate() 
	{	
		return publishDate;
	}

	public void setPublishDate(Date publishDate) 
	{
		this.publishDate = publishDate;
	}
	
	public long getElapsedTime() 
	{
		return (new Date()).getTime() - publishDate.getTime();
	}
}
